package com.andong.controller;



import com.andong.annotations.AccessControl;
import com.andong.domain.entity.RealScore;
import com.andong.domain.pojo.Result;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.andong.service.RealScoreService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;

import static com.andong.utils.SystemConstant.*;

/**
 * 学员真实成绩表(RealScore)表控制层
 *
 * @author makejava
 * @since 2024-02-27 11:40:40
 */
@RestController
@RequestMapping("/realScore")
public class RealScoreController {
    /**
     * 服务对象
     */
    @Resource
    private RealScoreService realScoreService;

    @GetMapping("/{id}")
    @AccessControl(roles = {STUDENT, COACH})
    public Result getById(@PathVariable Long id) {
        return realScoreService.getScoreById(id);
    }

    @PostMapping()
    @AccessControl(roles = {STUDENT, COACH})
    public Result saveScore(@RequestBody RealScore realScore) {
        return realScoreService.saveScore(realScore);
    }
}

